home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
EnigmA Amiga Run 1999 March
/
EnigmA AMIGA RUN 35 (1999)(G.R. Edizioni)(IT)[!][issue 1999-03].iso
/
earcd
/
devel
/
vbcc-ppc
/
machines
/
amigappc
/
include
/
stdarg.h
< prev
next >
Wrap
C/C++ Source or Header
|
1999-01-01
|
1KB
|
53 lines
/* stdarg.h - PowerPC */
#ifndef __STDARG_H
#define __STDARG_H 1
typedef struct {
int gpr;
int fpr;
char *regbase;
char *membase;
} va_list;
char *__va_start(void);
char *__va_regbase(void);
int __va_fixedgpr(void);
int __va_fixedfpr(void);
#define va_start(vl,dummy) \
( \
vl.gpr=__va_fixedgpr(), \
vl.fpr=__va_fixedfpr(), \
vl.regbase=__va_regbase(), \
vl.membase=__va_start() \
)
#define va_end(vl) (vl.regbase=vl.membase=0)
#define __va_size(type) ((sizeof(type)+3)/4*4)
#define va_arg(vl,type) \
( \
(__typeof(type)&15)>8? \
(vl.membase+=__va_size(type),((type*)vl.membase)[-1]) \
: \
( \
(((__typeof(type)&15)==5||(__typeof(type)&15)==6)) ? \
( \
++vl.fpr<=8 ? \
((type*)(vl.regbase+32))[vl.fpr-1] \
: \
(vl.membase+=__va_size(type),((type*)vl.membase)[-1]) \
) \
: \
( \
++vl.gpr<=8 ? \
((type*)(vl.regbase+0))[vl.gpr-1] \
: \
(vl.membase+=__va_size(type),((type*)vl.membase)[-1]) \
) \
) \
)
#endif